<!DOCTYPE html>
<html>
<head>
	{include file="common_header" /}
	{include file="common_top" /}
</head>
<body>

  <div class="layui-fluid">
    <div class="layui-card">
      <div class="layui-card-header">修改通道</div>
      <div class="layui-card-body" style="padding: 15px;">
        <form class="layui-form" action="" lay-filter="component-form-group">

          
          <div class="layui-form-item">
            <label class="layui-form-label">用户名称</label>
            <div class="layui-input-block">
              <input name="title" type="text" disabled class="layui-input" id="title" value="{$info['u_phone']}" readonly="readonly"   placeholder="用户名称">
            </div>
          </div>
		  
		  <div class="layui-form-item">
            <label class="layui-form-label">用户余额</label>
            <div class="layui-input-block">
              <input name="tag" type="text" disabled class="layui-input" id="tag" value="{$info['u_balance']}" readonly="readonly"   placeholder="用户余额">
            </div>
          </div>
          
          <div class="layui-form-item">
            <label class="layui-form-label">充值金额</label>
            <div class="layui-input-block">
              <input name="tag" type="text" disabled class="layui-input" id="tag" value="{$info['r_money']}" readonly="readonly"   placeholder="充值金额">
            </div>
          </div>
          
          <div class="layui-form-item">
            <label class="layui-form-label">审核备注</label>
            <div class="layui-input-block">
              <input name="tag" type="text" class="layui-input" id="content"   placeholder="审核备注">
            </div>
          </div>

          <div class="layui-form-item">
            <label class="layui-form-label">审核状态</label>
            <div class="layui-input-block">
              <input type="radio" name="status" value="2" title="入帐" checked="">
              <input type="radio" name="status" value="3" title="拒付">
            </div>
          </div>       
          <div class="layui-form-item layui-layout-admin">
            <div class="layui-input-block">
              <div class="layui-footer" style="left: 0;">
                <div class="layui-btn sub">立即提交</div>
                <button type="reset" class="layui-btn layui-btn-primary ">重置</button>
              </div>
            </div>
          </div>
        </form>
      </div>
    </div>
  </div>
{include file="common_footer" /} 
<script>
$(".sub").click(function(){
	//if(!$(".btn").hasClass("sub")){return false;}
	var content        = $("#content").val();
	var status       = $("input[name='status']:checked").val();

	if(content == ""){
		show_error("审核备注不能为空");
		return false
	}
	

	$.ajax({
		type:"POST",
		url:"{:url('recharge/edit')}",
		dataType:"json",
		data:{
			id:{$info['r_id']},
			content:content,
			status:status,
		},
		success:function(res){
			if(res.status == "success"){
				show_toast_callurl(res.data,"{:url('recharge/index')}","success");
			}else{
				show_error(res.data);
			}
		},
		error:function(jqXHR){
			console.log("Error: "+jqXHR.status);
		},
	});
	
});
</script>
</body>
</html>
